import request from '@/utils/request'

export function listAd(query) {
  return request({
    url: '/manager/recommend',
    method: 'get',
    params: { 'page': query.page - 1, 'size': query.size, 'sort': query.sort, 'productCode': query.productCode }
  })
}

export function createAd(data) {
  return request({
    url: 'manager/recommend',
    method: 'post',
    data
  })
}

export function readAd(data) {
  return request({
    url: '/ad/read',
    method: 'get',
    data
  })
}

export function updateAd(data) {
  return request({
    url: '/manager/recommend/'+data.recommendId,
    method: 'PUT',
    data
  })
}

export function deleteAd(recommendId) {
  return request({
    url: 'manager/recommend/'+recommendId,
    method: 'DELETE',
    
  })
}

export function listRecommendType() {
  return request({
    url: '/manager/recommend/listRecommendType',
    method: 'get'
  })
}
